package com.myebills.ebpsfrontend.cust.maxis;

import com.myebills.ebpsfrontend.cust.controller.*;
import com.checkfree.isolutions.customer.persist.Account;
import com.checkfree.isolutions.customer.persist.User;
import com.checkfree.isolutions.admin.ObjectId;
import com.checkfree.isolutions.statement.persist.Statement;
import com.checkfree.isolutions.statement.StatementSection;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class CusStmtFootnoteServlet_v1r00 extends EbppxTransactionServlet {

    /**
     *
     *
     */
    public void doTransaction(HttpServletRequest req, HttpServletResponse res)
    throws ServletException {
        try {
            final HttpSession session = req.getSession(false);
            if (null == session) {
                throw new ServletException("Session must be already established");
            }

            final EbppxUrlManager urlManager = getUrlManager(req);


            final String stmtDate = urlManager.getSecureParameter("stmtDate");
            if (stmtDate.length() == 0) {
                throw new ServletException("Missing statement date");
            }

            final String marketSegment   = urlManager.getSecureParameter("marketSegment");
            if (marketSegment.length() == 0) {
                throw new ServletException("Missing market segment");
            }

            req.setAttribute("stmtDate", stmtDate);
            req.setAttribute("marketSegment", marketSegment);

            forwardToMappedUrl(req, res, EbppxConstants.URL_JSP_PARAM);
        } catch (ServletException e) {
            // Just re-throw these
            throw e;
        } catch (Throwable t) {
            throw new ServletException(t.toString(), t);
        }
    }
}